home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / et / et3_0-a1.lha / et3 / src / DevBitmap.h < prev    next >
C/C++ Source or Header  |  1992-08-25  |  2KB  |  70 lines

  1. #ifndef DevBitmap_First
  2. #ifdef __GNUG__
  3. //pragma once
  4. #pragma interface
  5. #endif
  6. #define DevBitmap_First
  7.  
  8. #include "Types.h"
  9. #include "Point.h"
  10. #include "Ink.h"
  11.  
  12. class WindowPort;
  13. class WindowColorMap;
  14.  
  15. class DevBitmap {
  16.     int refcnt;
  17. public:
  18.     Point size;
  19.     u_short depth;
  20.     ColorMap *cmap;
  21. protected:
  22.     DevBitmap(Point sz, u_short depth= 1);
  23.     DevBitmap(DevBitmap *dbm);
  24.     virtual ~DevBitmap();
  25. public:
  26.     void Ref()
  27.     { refcnt++; }
  28.     void Unref();
  29.     
  30.     virtual int BytesPerLine();
  31.     virtual void SetPixel(u_int x, u_int y, u_long value);
  32.     virtual u_long GetPixel(u_int x, u_int y);
  33.     virtual void SetRGB(u_int x, u_int y, RGB *rgb);
  34.     virtual void GetRGB(u_int x, u_int y, RGB *rgb);
  35.     virtual u_long GetByte(u_int x, u_int y);
  36.     virtual void SetRow(int row, byte *rowdata, int rowlen, int bitsperpixel);
  37.     virtual RGB GetColormapEntry(int x);
  38.     virtual void SetColormapEntry(int x, RGB&);
  39.     virtual int GetColormapSize();
  40.     virtual void SetColormapSize(int);
  41.     virtual DevBitmap *DeepClone();
  42.     virtual void ReadData(IStream &is, int bitsperpixel, int pad);
  43.  
  44.     virtual DevBitmap *DevAllocBitmap(Point s, u_short d);
  45.     virtual void DevBitBlt(int x, int y, int w, int h, int op, DevBitmap *s, int sx, int sy);
  46.     virtual DevBitmap *DevScaleBitmap(Point ss);
  47.  
  48.     virtual void DevHalftone(WindowColorMap *wcm, DevBitmap *spr);
  49.     virtual void DevFloydSteinberg(WindowColorMap *wcm, DevBitmap *spr);
  50.  
  51.     Point Size()
  52.     { return size; }
  53.     int Depth()
  54.     { return depth; }
  55.     int ShortsPerLine()
  56.     { return ((size.x-1)/16+1)*depth; }
  57.  
  58.     virtual void DevMapColors(DevBitmap *src, u_long *map);
  59.     virtual DevBitmap *PrepareBitmap(WindowPort *port, Point e, DevBitmap *mask);
  60.     DevBitmap *FindInCache(WindowColorMap *wcm, Point scale);
  61.     void AddToCache(DevBitmap *dbm, WindowColorMap *wcm);
  62.  
  63.     void ExpandColors(WindowColorMap *wcm, DevBitmap *dbm, DevBitmap *mask);
  64.     void MapColors(WindowColorMap *wcm, DevBitmap *dbm, DevBitmap *mask);
  65.     void ReduceColors(WindowColorMap *wcm, DevBitmap *dbm, DevBitmap *mask);
  66. };
  67.  
  68. #endif
  69.  
  70.